package cn.mavor.day0920;

public class ChineseStringExample {
    public static void main(String[] args) {
        String chineseString = "汉字";
        char[] chars = chineseString.toCharArray();
        byte[] bytes = chineseString.getBytes();

        System.out.println("汉字字符串: " + chineseString);
        System.out.println("字符数组:");
        for (int i = 0; i < chars.length; i++) {
            System.out.println("字符 " + i + ": " + chars[i]);
        }
        System.out.println("字节数组:");
        for (int i = 0; i < bytes.length; i++) {
            System.out.println("字节 " + i + ": " + bytes[i]);
        }
    }
}